import request from '@/config/axios'

export interface DrawingTaskVO {
  id: number
  explainText: string
  practicalOperatingTime: number
  componentName: string
  workTaskId: number
  orderTaskId: number
  proportionNum: number
  designer: string
  scheduleProportion: number
  designerJobNum: string
  dictJobOrderStatus: number
  planStartDate: localdate
  planEndDate: localdate
  ratedOperatingTime: number
}

// 查询技术管理-图纸制作-制图任务单列表
export const getDrawingTaskPage = async (params) => {
  return await request.get({ url: `/technology/drawing-task/page`, params })
}

// 查询技术管理-图纸制作-制图任务单详情
export const getDrawingTask = async (id: number) => {
  return await request.get({ url: `/technology/drawing-task/get?id=` + id })
}

// 新增技术管理-图纸制作-制图任务单
export const createDrawingTask = async (data: DrawingTaskVO) => {
  return await request.post({ url: `/technology/drawing-task/create`, data })
}

// 修改技术管理-图纸制作-制图任务单
export const updateDrawingTask = async (data: DrawingTaskVO) => {
  return await request.put({ url: `/technology/drawing-task/update`, data })
}

// 删除技术管理-图纸制作-制图任务单
export const deleteDrawingTask = async (id: number) => {
  return await request.delete({ url: `/technology/drawing-task/delete?id=` + id })
}

// 导出技术管理-图纸制作-制图任务单 Excel
export const exportDrawingTask = async (data) => {
  return await request.download({ url: `/technology/drawing-task/export-excel`, data })
}

// 开始/暂停 技术管理-图纸制作-制图任务单
export const operateDrawingTask = async (params) => {
  return await request.get({ url: `/technology/drawing-task/option`,params })
}

//提交延期申请
export const subExtensionRequest = async (data) => {
  return await request.post({ url: `/technology/drawing-task/submitExtensional`, data })
}

//查看延期申请详情
export const getExtensionRequestDetail = async (params) => {
  return await request.get({ url: `/technology/drawing-task/getExtensionalDetail`, params })
}

//完工 查询订单、产品、客户信息
export const getDesignCompletionSheetData = async (params) => {
  return await request.get({ url: `/technology/drawing-work-task/get`, params })
}
